#include "ReferenceCounter.h"

namespace Core
{
	rtReferenceCounter::rtReferenceCounter(void)
	{
		m_RefCount.setValue(0);
	}


	rtReferenceCounter::~rtReferenceCounter(void)
	{
	}

	int rtReferenceCounter::addRef()
	{
		return ++m_RefCount;
	}

	int rtReferenceCounter::decreaseRef()
	{
		int newRef = --m_RefCount;
		if(newRef == 0)
		{
			delete this;
		}
		return newRef;
	}
}

